/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
  if (str.length != 11 && !str.match("@*(.com){1,1}")) {
    return false
  } else {
    return true
  }
}

export function validPassword(str) {
  if(str == ''){
    return false
  }else{
    return true
  }
}

export function validIdNo(str) {
  let reg_idNo = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$/
  if(!reg_idNo.test(str)){
    return false
  }else{
    return true
  }
}
